
using System;
using System.Resources;
using System.IO;
using System.Collections.Generic;

namespace Gamadus.Builder
{
	public class ResourceGenerator
	{
		ResourceWriter resWrite;
		public ResourceGenerator(string path)
		{
			resWrite = new ResourceWriter(path);
		}
		public void Add(string file, string name)
		{
			BinaryReader bRead = new BinaryReader(new StreamReader(file).BaseStream);
			List<byte> bytes = new List<byte>();
			byte b;
			while (bRead.BaseStream.Position < bRead.BaseStream.Length)
			{
				b = bRead.ReadByte();
				bytes.Add(b);
			}
			byte[] bytearr = bytes.ToArray();
			bRead.Close();
			resWrite.AddResource(name,bytearr);
		}
		public void Generate()
		{
			resWrite.Generate();
			resWrite.Close();
		}
	}
}
